<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery.min.js"></script>
</head>
<body>
    <div>青花瓷</div>
    <div>轨迹</div>
    <div>东风破</div>
    <div>发如雪</div>
    <script>
        var arr = ['red', 'blue', 'green', 'purple'];
        // 1.遍历数组
        $.each(arr, function(i, ele){
            console.log(i, ele);
        });

        // 2.遍历对象 属性和值
        var obj = {
            name: '张三',
            address:'郑州',
            sex:true
        }
        $.each(obj, function(i, ele){
           console.log(i, ele);
        });

        // 3.遍历数组
        $('div').each(function(i, ele){
            console.log(i, ele);
        });
    </script>
</body>
</html>